//
//  WYCAboutMeController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/2.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCAboutMeController.h"

@interface WYCAboutMeController ()

@end

@implementation WYCAboutMeController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //setNav
    [self setupNav];
    
    
    //创建界面
    [self setupCreat];
}
- (void)setupCreat{
    UIImageView * logoimageView = [[UIImageView alloc] init];
    logoimageView.frame = CGRectMake(ScreenWidth / 2 - 150 * px, 64 + 100 * px, 300 * px, 300 * px);
    logoimageView.image = [UIImage imageNamed:@"图层12"];
//    logoimageView.backgroundColor = [UIColor redColor];
    [self.view addSubview:logoimageView];
    
    
    UIImageView * textimageView = [[UIImageView alloc] init];
    textimageView.frame = CGRectMake(ScreenWidth / 2 - 120 * px, CGRectGetMaxY(logoimageView.frame) + 20 * px, 240 * px, 80 * px);
    textimageView.image = [UIImage imageNamed:@"掌上还"];
//    textimageView.backgroundColor = [UIColor redColor];
    [self.view addSubview:textimageView];
    
    UILabel * comenttitle = [[UILabel alloc] init];
    comenttitle.frame = CGRectMake(40 * px, CGRectGetMaxY(textimageView.frame) + 100 * px, ScreenWidth - 80 * px, 400 * px);
//    comenttitle.text = @"        厦门你娱我乐有限公司是一家综合性软件开发、运营的互联网公司，公司重磅打造的“掌上还”APP项目是专注于国内信用卡智能管理服务，助力于为中国信用卡用户打造完美、科学的信用卡账单智能提醒和管理等一体化服务，让持卡用户避免逾期，成为中国数亿信用卡用户的第一选择。";
    comenttitle.font = [UIFont systemFontOfSize:50 * px];
    comenttitle.numberOfLines = 0;
    [self.view addSubview:comenttitle];
    
    UILabel * dizhi = [[UILabel alloc] init];
    dizhi.frame = CGRectMake(40 * px, CGRectGetMaxY(comenttitle.frame) + 100 * px, ScreenWidth - 80 * px, 120 * px);
    dizhi.text = @"总部地址：福建省厦门市思明区塔埔路观音山营运中心7号楼1201室";
    dizhi.font = [UIFont systemFontOfSize:50 * px];
    dizhi.numberOfLines = 0;
    [self.view addSubview:dizhi];
    
    UILabel * iphonelabel = [[UILabel alloc] init];
    iphonelabel.frame = CGRectMake(40 * px, CGRectGetMaxY(dizhi.frame) + 50 * px, 300 * px, 60 * px);
    iphonelabel.text = @"招商热线：";
    iphonelabel.font = [UIFont systemFontOfSize:50 * px];
    iphonelabel.numberOfLines = 0;
    [self.view addSubview:iphonelabel];
    
    UILabel * iphone = [[UILabel alloc] init];
    iphone.frame = CGRectMake(CGRectGetMaxX(iphonelabel.frame), CGRectGetMaxY(dizhi.frame) + 50 * px, 1000 * px, 60 * px);
    iphone.text = @"400-822-7776";
    iphone.textColor = wycMain;
    iphone.font = [UIFont systemFontOfSize:50 * px];
    iphone.numberOfLines = 0;
    [self.view addSubview:iphone];
    
    UILabel * milllabel = [[UILabel alloc] init];
    milllabel.frame = CGRectMake(40 * px, CGRectGetMaxY(iphonelabel.frame) + 50 * px, 300 * px, 60 * px);
    milllabel.text = @"官网地址：";
    milllabel.font = [UIFont systemFontOfSize:50 * px];
    milllabel.numberOfLines = 0;
    [self.view addSubview:milllabel];
    
    
    UILabel * mill = [[UILabel alloc] init];
    mill.frame = CGRectMake(CGRectGetMaxX(milllabel.frame), CGRectGetMaxY(iphonelabel.frame) + 50 * px, ScreenWidth - 80 * px, 60 * px);
    mill.textColor = wycMain;
    mill.text = @"www.zhangshanghuan.com";
    mill.font = [UIFont systemFontOfSize:50 * px];
    mill.numberOfLines = 0;
    [self.view addSubview:mill];
    
    
    UILabel * youxianglabel = [[UILabel alloc] init];
    youxianglabel.frame = CGRectMake(40 * px, CGRectGetMaxY(milllabel.frame) + 50 * px, 300 * px, 60 * px);
    youxianglabel.text = @"邮箱地址：";
    youxianglabel.font = [UIFont systemFontOfSize:50 * px];
    youxianglabel.numberOfLines = 0;
    [self.view addSubview:youxianglabel];
    
    UILabel * youxiang = [[UILabel alloc] init];
    youxiang.frame = CGRectMake(CGRectGetMaxX(youxianglabel.frame), CGRectGetMaxY(milllabel.frame) + 50 * px, ScreenWidth - 80 * px, 60 * px);
    youxiang.textColor = wycMain;
    youxiang.text = @"admin@zhangshanghuan.com";
    youxiang.font = [UIFont systemFontOfSize:50 * px];
    youxiang.numberOfLines = 0;
    [self.view addSubview:youxiang];
    
    
    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
    
    // 获取App的版本号
    NSString *appVersion = [infoDic objectForKey:@"CFBundleShortVersionString"];
    WYCLog(@"=======%@",appVersion);
    
    
    UILabel * appVersionlabel = [[UILabel alloc] init];
    appVersionlabel.frame = CGRectMake(0,CGRectGetMaxY(youxiang.frame) + 100 * px,ScreenWidth,60 * px);
    appVersionlabel.text = appVersion;
    appVersionlabel.textColor = WYCRGBColor(167, 175, 179);
    appVersionlabel.font = [UIFont systemFontOfSize:40 * px];
    appVersionlabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:appVersionlabel];
    
    
}
#pragma make ------->>nav界面修改
- (void)setupNav{
    
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"关于我们";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self.navigationController.navigationBar setBarTintColor:wycMain];
    
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    
    
    self.navigationController.navigationBar.hidden = YES;
    
    
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = WYCmainColor;
    [self.view addSubview:NavView];
    
    
    
    CALayer *bottomLineLayer = [[CALayer alloc] init];
    bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    bottomLineLayer.backgroundColor = WYCmainColor.CGColor;
    [NavView.layer addSublayer:bottomLineLayer];
    
    
    
    
    
    //返回按钮
    UIButton *  fanhuibutton = [[UIButton alloc] init];
    [fanhuibutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [fanhuibutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    fanhuibutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:fanhuibutton];
    
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = @"关于我们";
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}

@end
